package strategyPattern.demo1;

import java.util.Arrays;
import java.util.Comparator;

/**
 * @author： pang-yun
 * @date： 2022-01-06 16:01
 * 功能目的 ：用于
 */

public class Client {
    public static void main(String[] args) {
        Comparator<Integer> comparator = new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                if (o1 > o2) {
                    return 1;
                } else {
                    return -1;
                }
            }
        };

        Integer[] data = {5, 6, 23, 43, 1, 4};

        Arrays.sort(data, comparator);
        System.out.println(Arrays.toString(data));

    }
}
